<template>
	<view class="my">
		<!-- 头部 -->
		<view class="my-header">
			<view class="header-main">
				<view class="header-config" @tap="goConfig">
					<image class="config-img" src="../../static/img/config.png" mode=""></image>
				</view>
				<view class="header-logo">
					<image class="logo-img" :src="userInfo.userInfo.imgUrl?userInfo.userInfo.imgUrl:'../../static/img/default.webp'" mode=""></image>
					<view class="logo-name">{{userInfo.userInfo.userName?userInfo.userInfo.userName:'用户名'}}</view>
				</view>
			</view>
		</view>
		<!-- 我的订单 -->
		<view class="order">
			<view class="order-title" @tap="goOrder">
				<view>我的订单</view>
				<view>全部订单</view>
			</view>
			<view class="order-list">
				<view class="order-item">
					<image class="order-img" src="../../static/img/order1.png" mode=""></image>
					<view>待付款</view>
				</view>
				<view class="order-item">
					<image class="order-img" src="../../static/img/order2.png" mode=""></image>
					<view>待发货</view>
				</view>
				<view class="order-item">
					<image class="order-img" src="../../static/img/order3.png" mode=""></image>
					<view>待付款</view>
				</view>
				<view class="order-item">
					<image class="order-img" src="../../static/img/order4.png" mode=""></image>
					<view>待收货</view>
				</view>
				<view class="order-item">
					<image class="order-img" src="../../static/img/order5.png" mode=""></image>
					<view>退款管理</view>
				</view>
			</view>
		</view>
		<!-- 内容列表 -->
		<view class="my-content">
			<view class="my-content-item">
				<view>我的收藏</view>
				<view class="my-content-mark">></view>
			</view>
			<view class="my-content-item">
				<view>我的优惠券</view>
				<view class="my-content-mark">></view>
			</view>
			<view class="my-content-item">
				<view>我的收藏</view>
				<view class="my-content-mark">></view>
			</view>
			<view class="my-content-item">
				<view>我的积分</view>
				<view class="my-content-mark">></view>
			</view>
			<view class="my-content-item">
				<view>加入超级VIP</view>
				<view class="my-content-mark">></view>
			</view>
			<view class="my-content-item">
				<view>帮助中心</view>
				<view class="my-content-mark">></view>
			</view>
			<view class="my-content-item">
				<view>联系客服</view>
				<view class="my-content-mark">></view>
			</view>
			<view class="my-content-item">
				<view>商家入驻</view>
				<view class="my-content-mark">></view>
			</view>
		</view>
		<tabBar currentPage="my"/>
	</view>
</template>

<script>
	import tabBar from "@/components/tabBar/tabBar.vue"
	export default {
		data() {
			return {

			};
		},
		methods:{
			goConfig(){
				uni.navigateTo({
					url:"/pages/my-config/my-config"
				})
			},
			goOrder(){
				uni.navigateTo({
					url:"/pages/my-order/my-order"
				})
			}
		},
		computed:{
			userInfo(){
				return this.$store.state.user
			}
		}
	}
</script>

<style lang="scss" scoped>
	.my {
		padding-bottom: 120rpx;
		.my-header {
			background: url('@/static/img/mybg.png') no-repeat;
			width: 100%;
			height: 400rpx;

			.header-main {
				position: relative;
				/* #ifdef APP-PLUS */
					top: 110rpx;
				/* #endif */
				top: 80rpx;
				.header-config {
					position: absolute;
					left: 20rpx;

					.config-img {
						width: 40rpx;
						height: 40rpx;
					}
				}

				.header-logo {
					position: absolute;
					width: 140rpx;
					left: 0;
					right: 0;
					margin: auto;

					.logo-img {
						width: 140rpx;
						height: 140rpx;
						border-radius: 50%;
						border: 2rpx solid #fff;
						background-color: #fff;
					}

					.logo-name {
						color: #fff;
						font-weight: bold;
						text-align: center;
						margin-top: 20rpx;
					}
				}
			}
		}

		// 我的订单
		.order {
			.order-title {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 20rpx;
			}

			.order-list {
				display: flex;
				padding: 20rpx;

				.order-item {
					display: flex;
					flex: 1;
					align-items: center;
					justify-content: center;
					flex-direction: column;

					.order-img {
						width: 66rpx;
						height: 66rpx;
					}
				}
			}
		}

		// 内容列表
		.my-content {
			margin: 20rpx 0;
			padding: 0 30rpx;
			.my-content-item {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 26rpx 0;
				border-bottom: 2rpx solid #ccc;
				.my-content-mark{
					font-family: '楷体';
				}
			}
		}
	}
</style>
